package top.oneit.jdownload.test;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.shape.SVGPath;
import javafx.scene.text.Text;
import javafx.stage.Stage;

/**
 * @author lingkang
 * Created by 2022/1/5
 */
public class MyIcon extends Application {
    @Override
    public void start(Stage stage) throws Exception {
        //Creating a SVGPath object
        SVGPath svgPath = new SVGPath();
        String path = "M1149 414q0 26 -19 45l-181 181l181 181q19 19 19 45q0 27 -19 46l-90 90q-19 19 -46 19q-26 0 -45 -19l-181 -181l-181 181q-19 19 -45 19q-27 0 -46 -19l-90 -90q-19 -19 -19 -46q0 -26 19 -45l181 -181l-181 -181q-19 -19 -19 -45q0 -27 19 -46l90 -90q19 -19 46 -19 q26 0 45 19l181 181l181 -181q19 -19 45 -19q27 0 46 19l90 90q19 19 19 46zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z";
        //Setting the SVGPath in the form of string
        svgPath.setContent(path);
        svgPath.resize(20,20);
        Text button=new Text("按钮");
        //Creating a Group object
        Group root = new Group(button,svgPath);
        //Creating a scene object
        Scene scene = new Scene(root, 600, 300);
        //Setting title to the Stage
        stage.setTitle("Drawing a Sphere");
        //Adding scene to the stage
        stage.setScene(scene);
        //Displaying the contents of the stage
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }

}
